import pymysql
conn = pymysql.connect(host="127.0.0.1",
                       port=3306,
                       user="root",
                       password="root",
                       database="books",
                       charset="utf8",
                       autocommit=True)
cursor = conn.cursor()
sql = "update t_book set `read`=1 where title like '西游%'"
cursor.execute(sql)
print(cursor.rowcount)
cursor.close()
conn.close()